﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using RockCompany.Common.Lib;
using RockCompany.Common.Constant;
using RockCompany.Master.View;
using RockCompany.Common.Forms;
using System.IO;

namespace RockCompany.Master.View
{
    public partial class SC01 : ParentFrm
    {
        private SC03 frm_QLUser;
        private SC04 frm_QLThanhPham;
        private SI01 frm_SI01;
        private SW01B frm_SW01B;
        private SI03B frm_SI03B;
        private SI02B frm_SI02B;
        private SI07B frm_SI07B;
        private SI04 frm_SI04;
        private SW02 frm_SW02;

        private Translator trans;
        private string sUserName;

        public SC01()
        {
            InitializeComponent();
        }

        public SC01(Translator trans, string sUname, Form caller): base(sUname, caller)
        {
            this.trans = trans;
            InitializeComponent();
            trans.controlTranslate(this);
            this.sUserName = sUname;
        }

        private void button_QLXuatTP_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm_QLThanhPham = new SC04(trans, sUserName, this);
            frm_QLThanhPham.Show();
        }

        private void button_QLNguyenLieu_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm_SI01 = new SI01(trans, sUserName, this);
            frm_SI01.Show();
        }

        private void button_QLUser_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm_QLUser = new SC03(trans, sUserName, this);
            frm_QLUser.Show();
        }

        private void button_QLCongLenh_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm_SW01B = new SW01B(trans, sUserName, this);
            frm_SW01B.Show();
        }

        private void button_QLHangNhap_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm_SI03B = new SI03B(trans, sUserName, this);
            frm_SI03B.Show();
        }

        private void button_QLXuatNL_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm_SI02B = new SI02B(trans, sUserName, this);
            frm_SI02B.Show();
        }

        private void button_QLNhapTP_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm_SI07B = new SI07B(trans, sUserName, this);
            frm_SI07B.Show();
        }

        private void button_TheoDoiTonKho_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm_SI04 = new SI04(trans, sUserName, this);
            frm_SI04.Show();
        }

        private void button_TheoDoiCL_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm_SW02 = new SW02(trans, sUserName, this);
            frm_SW02.Show();
        }

        public void lockForm()
        {
            button_QLNguyenLieu.Enabled = false;
            button_QLCongLenh.Enabled = false;
            button_QLHangNhap.Enabled = false;
            button_QLNhapTP.Enabled = false;
            button_QLUser.Enabled = false;
            button_QLXuatNL.Enabled = false;
            button_QLXuatTP.Enabled = false;
            button_TheoDoiCL.Enabled = false;
            button_TheoDoiTonKho.Enabled = false;

            InforDialog.showWarningrBox(this, trans.getMessageCaption(CommonConstantIF.TRIAL_EXPIRED), trans.getMessageCaption(CommonConstantIF.WarningBoxCap));

        }
    }
}
